# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=pipewire
pkgver=0.1.5+2+g8f67aa2
pkgrel=2
pkgdesc="Server and user space API to deal with multimedia pipelines"
url="http://pipewire.org"
license=(LGPL2.1)
arch=(i686 x86_64)
depends=(gstreamer gst-plugins-base v4l-utils)
makedepends=(git meson doxygen graphviz xmltoman ffmpeg jack2 libva)
optdepends=(ffmpeg jack2 libva)
_commit=8f67aa2c3887fa72ccf6bbcd2d10b4e5b1a6da54  # master
source=("git+https://github.com/PipeWire/pipewire#commit=$_commit"
        svg.diff)
sha256sums=('SKIP'
            '23df81ab6c70e1d1e29505f846abffe3530495fdcede6fbed08f42b4c86e6e65')


pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
  patch -Np1 -i ../svg.diff
}

build() {
  cd build
  meson setup --prefix=/usr --sysconfdir=/etc --buildtype=release ../$pkgname
  ninja
}

check() {
  cd build
  meson test
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
